package com.example.demo.controller;

import com.example.demo.dto.DemoDto;
import com.example.demo.service.DemoService;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Inject;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.data.annotation.Cache;

/**
 * @author airhead
 */
@Controller
@Mapping("/demo")
public class DemoController {
    @Inject private DemoService service;
    @Get
    @Mapping("hello")
    public String hello() {
        return "Hello Demo!";
    }

    @Get
    @Mapping("cache")
    public DemoDto cache() {
        return service.cache();
    }
}
